﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TvTipper.Entities
{
    public class TvProgram : TvProgramMetadata
    {
        private int m_seasons;
        private string m_desc;

        public TvProgram()
        {
            Generes = new List<int>();
        }

        public virtual string Description
        {
            get
            {
                return m_desc;
            }
            protected internal set
            {
                if (value != m_desc)
                {
                    m_desc = value;
                    NotifyPropertyChanged("Description");
                }
            }
        }
        public virtual int Seasons 
        {
            get
            {
                return m_seasons;
            }
            protected internal set
            {
                if (m_seasons != value)
                {
                    m_seasons = value;
                    NotifyPropertyChanged("Seasons");
                }
            }
        }

        public virtual string ImageUrl { get; protected internal set; }
        public virtual string OriginCountry { get; protected internal set; }

        public virtual IList<int> Generes { get; protected internal set; }
        public virtual IList<CastEntity> Cast { get; protected internal set; }

        public TvProgramMetadata GetMetadata()
        {
            return new TvProgramMetadata()
            {
                Id = this.Id,
                Name = this.Name,
                StartYear = this.StartYear,
                EndYear = this.EndYear,
                OverRank = this.OverRank,
                UserRank = this.UserRank
            };
        }
    }
}
